<#macro mapperEl pre="" end="">
  ${r"${"}${pre}${end}}
</#macro>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HLRMS-好邻后台管理系统</title>
<script type="text/javascript" src="../js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>


<link type="text/css" rel="stylesheet" href="../css/main.css" />

<style type="text/css">
body {
	width: 100%;
	height: 100%;
	background-color: #FFFFFF;
	text-align: center;
}

.input_txt {
	width: 200px;
	height: 20px;
	line-height: 20px;
}

.info {
	height: 40px;
	line-height: 40px;
}

.info th {
	text-align: right;
	width: 65px;
	color: #4f4f4f;
	padding-right: 5px;
	font-size: 13px;
}

.info td {
	text-align: left;
}
</style>
<script language="JavaScript" type="text/javascript">
	//只能输入数字
	function clearNoNum(obj) {
		obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符  
		obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是. 
		obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.   
		obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
	}

	var dg;
	$(document).ready(function() {
	
		dg = frameElement.lhgDG;
		dg.addBtn('ok', '保存', function() {
			checkInfo();
			$("#${className_x}Form").submit();
		});
		
	});

	//提交表单的时候进行检查
	function checkInfo() {
	   //TODO:
	}
    
	//保存成功
	function success() {
		if (dg.curWin.document.forms[0]) {
			dg.curWin.document.forms[0].action = dg.curWin.location + "";
			dg.curWin.document.forms[0].submit();
		} else {
			dg.curWin.location.reload();
		}
		dg.cancel();
	}

	function failed() {
		//TODO:
	}
</script>
</head>
<body>
	<form action="save.html" name="${className_x}Form" id="${className_x}Form"
		target="result" method="post" onsubmit="checkInfo();">
		
		<input type="hidden" name="${key_x}" value="<@mapperEl pre="${className_x}." end="${key_x}"/>" />
        
		<table border="0" cellpadding="0" cellspacing="0">
			
		  <#list tableCarrays as tableCarray>
		  
			<tr class="info">
				<th>${tableCarray.remark}:</th>
				<td>
				 <#if tableCarray.carrayType=="java.util.Date">
			        <input type="text" name="${tableCarray.carrayName_x}"
					value="<fmt:formatDate value="<@mapperEl pre="${carrayName_x}." end="${tableCarray.carrayName_x}"/>" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker()" readonly="readonly" style="width: 200px;" />
			         <#else>
			         <input type="text" name="${tableCarray.carrayName_x}" id="${tableCarray.carrayName_x}" class="input_txt"
					value="<@mapperEl pre="${className_x}." end="${tableCarray.carrayName_x}"/>" />
			      </#if>
				</td>
			</tr>
           </#list>
		</table>
	</form>
	<iframe name="result" id="result" src="about:blank" frameborder="0"
		width="0" height="0"></iframe>
</body>
</html>